package com.matrix.async.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.matrix.async.bean.AsyncErrorLogBean;
import com.matrix.async.service.AsyncErrorLogService;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
import com.matrix.core.web.BaseAction;

/**
 * 异步任务错误日志
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping(value = "developer/asyncErrorLog")
public class AsyncErrorLogAction extends BaseAction {
	
	@Autowired
	AsyncErrorLogService asyncErrorLogService;

	public static final String BEV = "AsyncErrorLog_BEV";

	/**
	 * 列表显示
	 */
	@RequestMapping(value = "/list")
	public @ResponseBody AjaxResult list(AsyncErrorLogBean asyncErrorLogBean, PaginationVO pageVo) {
		return showList(asyncErrorLogService, asyncErrorLogBean, pageVo);
	}

	/**
	 * 查看错误详情接口
	 */
	@RequestMapping(value = "detail")
	public String detail(String id) {
		AsyncErrorLogBean asyncErrorLogBean;
		if (id != null) {
			asyncErrorLogBean = asyncErrorLogService.findById(id);
			WebUtil.getRequest().setAttribute("obj", asyncErrorLogBean);
			WebUtil.setSessionAttribute(BEV, asyncErrorLogBean);
		}
		return "developer/async/asyErrorLog-detail";
	}

	/**
	 * 进入列表界面
	 */
	@RequestMapping(value = "/toList")
	public String toList() {
		return "developer/async/asyErrorLog-list";
	}
}
